package com.joplus.housekeeper.network;

import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.DELETE;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.QueryMap;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

/**
 * author： ccm
 * time： 2017/7/5.
 * description：
 */

interface ApiService {
    @GET()
    Call<ResponseBody> getWithUrl(@Url String url);

    @Streaming
    @GET
    Call<ResponseBody> downLoad(@Url String url);


    @FormUrlEncoded
    @POST()
    Call<ResponseBody> postWithMap(@Url String url, @FieldMap Map<String, Object> param);

    @POST()
    Call<ResponseBody> post(@Url String url);

    @Multipart
    @POST()
    Call<ResponseBody> postWithFile(@Url String url, @Part MultipartBody.Part body);

    @Multipart
    @POST()
    Call<ResponseBody> postWithFile(@Url String url, @Part MultipartBody.Part body, @PartMap Map<String, RequestBody> param);


    @DELETE()
    Call<ResponseBody> deleteWithUrl(@Url String url);


}
